#include <stdio.h>

int main( )
{
    int n;
    while ( scanf("%d", &n) != EOF )
    {
        float a, b, sum = 0, point = 0, t;
        int i;
        for ( i = 0; i < n; i++ )
        {
            scanf("%f%f", &a, &b);
            if ( b != -1 )
            {
                if ( b >= 90 ) t = 4;
                else if ( b >= 80 ) t = 3;
                else if ( b >= 70 ) t = 2;
                else if ( b >= 60 ) t = 1;
                else t = 0;
                sum += a * t;
                point += a;
            }
        }
        if ( point == 0 ) printf("-1\n");
        else printf("%.2f\n", sum / point);
    }
    return 0;
}
